import request from '@/api/request'

export const getStaffs = (params) => request.get('/staff/list', { params })
export const getStaff = (id) => request.get(`/staff/${id}`)
export const addStaff = (data) => request.post('/staff', data)
export const updateStaff = (data) => request.put('/staff', data)
export const deleteStaff = (id) => request.delete(`/staff/${id}`)
export const importStaffs = (file) => {
  const formData = new FormData()
  formData.append('file', file)
  return request.post('/staff/import', formData, { headers: { 'Content-Type': 'multipart/form-data' } })
}
export const exportStaffs = () => request.get('/staff/export', { responseType: 'blob' }) 